package bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 * User entity provides the base persistence definition of the User
 * entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class User implements java.io.Serializable {

	// Fields

	private Integer UId=-1;
	private String userfname;
	private String userlname;
	private Byte gender;
	private Date dob;
	private String email;
	private String password;
	private String userlocation;
	private Set posts = new HashSet(0);
	private Set userDestGradings = new HashSet(0);
	private Set travelogues = new HashSet(0);
	private Set albums = new HashSet(0);
	private Set statuses = new HashSet(0);
	private Set stories = new HashSet(0);
	private Set snapComments = new HashSet(0);
	private Set igroups = new HashSet(0);
	private Set members = new HashSet(0);
	private Set userAttractions = new HashSet(0);
	private Set atcSnapComments = new HashSet(0);
	private Set friendshipsForFriendId = new HashSet(0);
	private Set travelogueComments = new HashSet(0);
	private Set friendshipsForUId = new HashSet(0);
	private Set userSnapshots = new HashSet(0);
	private Set destSnapshots = new HashSet(0);
	private Set atcSnapshots = new HashSet(0);
	private Set postComments = new HashSet(0);
	private Set logTags = new HashSet(0);
	private Set snapTags = new HashSet(0);
	private Set destSnapComments = new HashSet(0);

	// Constructors

	/** default constructor */
	public User() {
	}
	/** minimal constructor */
	public User(String userfname, String userlname,
			Byte gender, Date dob, String email, String password) {
		this.UId = UId;
		this.userfname = userfname;
		this.userlname = userlname;
		this.gender = gender;
		this.dob = dob;
		this.email = email;
		this.password = password;
	}

	/** with ID constructor */
	public User(Integer UId, String userfname, String userlname,
			Byte gender, Date dob, String email, String password) {
		this.UId = UId;
		this.userfname = userfname;
		this.userlname = userlname;
		this.gender = gender;
		this.dob = dob;
		this.email = email;
		this.password = password;
	}
	
	/** full constructor */
	public User(Integer UId, String userfname, String userlname,
			Byte gender, Date dob, String email, String password,
			String userlocation, Set posts, Set userDestGradings,
			Set travelogues, Set albums, Set statuses, Set stories,
			Set snapComments, Set igroups, Set members, Set userAttractions,
			Set atcSnapComments, Set friendshipsForFriendId,
			Set travelogueComments, Set friendshipsForUId, Set userSnapshots,
			Set destSnapshots, Set atcSnapshots, Set postComments, Set logTags,
			Set snapTags, Set destSnapComments) {
		this.UId = UId;
		this.userfname = userfname;
		this.userlname = userlname;
		this.gender = gender;
		this.dob = dob;
		this.email = email;
		this.password = password;
		this.userlocation = userlocation;
		this.posts = posts;
		this.userDestGradings = userDestGradings;
		this.travelogues = travelogues;
		this.albums = albums;
		this.statuses = statuses;
		this.stories = stories;
		this.snapComments = snapComments;
		this.igroups = igroups;
		this.members = members;
		this.userAttractions = userAttractions;
		this.atcSnapComments = atcSnapComments;
		this.friendshipsForFriendId = friendshipsForFriendId;
		this.travelogueComments = travelogueComments;
		this.friendshipsForUId = friendshipsForUId;
		this.userSnapshots = userSnapshots;
		this.destSnapshots = destSnapshots;
		this.atcSnapshots = atcSnapshots;
		this.postComments = postComments;
		this.logTags = logTags;
		this.snapTags = snapTags;
		this.destSnapComments = destSnapComments;
	}

	// Property accessors

	public Integer getUId() {
		return this.UId;
	}

	public void setUId(Integer UId) {
		this.UId = UId;
	}

	public String getUserfname() {
		return this.userfname;
	}

	public void setUserfname(String userfname) {
		this.userfname = userfname;
	}

	public String getUserlname() {
		return this.userlname;
	}

	public void setUserlname(String userlname) {
		this.userlname = userlname;
	}

	public Byte getGender() {
		return this.gender;
	}

	public void setGender(Byte gender) {
		this.gender = gender;
	}

	public Date getDob() {
		return this.dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserlocation() {
		return this.userlocation;
	}

	public void setUserlocation(String userlocation) {
		this.userlocation = userlocation;
	}

	public Set getPosts() {
		return this.posts;
	}

	public void setPosts(Set posts) {
		this.posts = posts;
	}

	public Set getUserDestGradings() {
		return this.userDestGradings;
	}

	public void setUserDestGradings(Set userDestGradings) {
		this.userDestGradings = userDestGradings;
	}

	public Set getTravelogues() {
		return this.travelogues;
	}

	public void setTravelogues(Set travelogues) {
		this.travelogues = travelogues;
	}

	public Set getAlbums() {
		return this.albums;
	}

	public void setAlbums(Set albums) {
		this.albums = albums;
	}

	public Set getStatuses() {
		return this.statuses;
	}

	public void setStatuses(Set statuses) {
		this.statuses = statuses;
	}

	public Set getStories() {
		return this.stories;
	}

	public void setStories(Set stories) {
		this.stories = stories;
	}

	public Set getSnapComments() {
		return this.snapComments;
	}

	public void setSnapComments(Set snapComments) {
		this.snapComments = snapComments;
	}

	public Set getIgroups() {
		return this.igroups;
	}

	public void setIgroups(Set igroups) {
		this.igroups = igroups;
	}

	public Set getMembers() {
		return this.members;
	}

	public void setMembers(Set members) {
		this.members = members;
	}

	public Set getUserAttractions() {
		return this.userAttractions;
	}

	public void setUserAttractions(Set userAttractions) {
		this.userAttractions = userAttractions;
	}

	public Set getAtcSnapComments() {
		return this.atcSnapComments;
	}

	public void setAtcSnapComments(Set atcSnapComments) {
		this.atcSnapComments = atcSnapComments;
	}

	public Set getFriendshipsForFriendId() {
		return this.friendshipsForFriendId;
	}

	public void setFriendshipsForFriendId(Set friendshipsForFriendId) {
		this.friendshipsForFriendId = friendshipsForFriendId;
	}

	public Set getTravelogueComments() {
		return this.travelogueComments;
	}

	public void setTravelogueComments(Set travelogueComments) {
		this.travelogueComments = travelogueComments;
	}

	public Set getFriendshipsForUId() {
		return this.friendshipsForUId;
	}

	public void setFriendshipsForUId(Set friendshipsForUId) {
		this.friendshipsForUId = friendshipsForUId;
	}

	public Set getUserSnapshots() {
		return this.userSnapshots;
	}

	public void setUserSnapshots(Set userSnapshots) {
		this.userSnapshots = userSnapshots;
	}

	public Set getDestSnapshots() {
		return this.destSnapshots;
	}

	public void setDestSnapshots(Set destSnapshots) {
		this.destSnapshots = destSnapshots;
	}

	public Set getAtcSnapshots() {
		return this.atcSnapshots;
	}

	public void setAtcSnapshots(Set atcSnapshots) {
		this.atcSnapshots = atcSnapshots;
	}

	public Set getPostComments() {
		return this.postComments;
	}

	public void setPostComments(Set postComments) {
		this.postComments = postComments;
	}

	public Set getLogTags() {
		return this.logTags;
	}

	public void setLogTags(Set logTags) {
		this.logTags = logTags;
	}

	public Set getSnapTags() {
		return this.snapTags;
	}

	public void setSnapTags(Set snapTags) {
		this.snapTags = snapTags;
	}

	public Set getDestSnapComments() {
		return this.destSnapComments;
	}

	public void setDestSnapComments(Set destSnapComments) {
		this.destSnapComments = destSnapComments;
	}
	
	public Album checkAlbum(String albumName){
		if(this.albums.isEmpty())return null;
		Iterator<Album> i=this.albums.iterator();
		Album temp;
		while(i.hasNext()){
			temp=i.next();
			if(temp.getAlbumName().equals(albumName)){
				return temp;
			}
		}
		return null;
	}
	public UserSnapshot checkProfileSnapshot(){
		if(this.userSnapshots.isEmpty())return null;
		Iterator<UserSnapshot> i=this.userSnapshots.iterator();
		UserSnapshot temp;
		while(i.hasNext()){
			temp=i.next();
			if(temp.getIsprofilephto().equals((byte)1)){
				return temp;
			}
		}
		return null;
	}
}